import request from '@/commons/libraries/request'

export default {
  async get () {
    try {
      const ret = await request('/setting/my/profile/profile', {})
      return ret
    } catch (err) {
      return Promise.reject(new Error(`系统错误，请稍后再试！<br/>[${err.message}]`))
    }
  },
  async resetProfile (user) {
    try {
      const ret = await request('/setting/my/profile/resetProfile', user)
      return ret
    } catch (err) {
      return Promise.reject(new Error(`系统错误，请稍后再试！<br/>[${err.message}]`))
    }
  },
  async resetPassword (user) {
    try {
      const ret = await request('/setting/my/profile/resetPassword', user)
      return ret
    } catch (err) {
      return Promise.reject(new Error(`系统错误，请稍后再试！<br/>[${err.message}]`))
    }
  }
}
